//
//  JWWebController.m
//  见闻新闻
//
//  Created by brother on 16/3/1.
//  Copyright © 2016年 JoanBoat. All rights reserved.
//

#import "JWWebController.h"
#import "JWFeatured.h"
#import "JWFMDBHostpotTool.h"

@interface JWWebController ()

@property (weak, nonatomic) IBOutlet UIWebView *myWeb;


@end

@implementation JWWebController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    if ([self.delegate respondsToSelector:@selector(featuredWith)]) {
        
        JWFeatured *featured = [self.delegate featuredWith];
        if ([JWFMDBHostpotTool hostpotWithWhereId:featured.rd_id].count > 0) {
            NSMutableArray *mutArray = [JWFMDBHostpotTool hostpotWithWhereId:featured.rd_id];
            for (JWFeatured *featured in mutArray) {
                [self.myWeb loadHTMLString:featured.rd_html baseURL:nil];
                NSLog(@"111");
            }
        }else {
            NSLog(@"222");
            if (featured.rd_html) {
                [self.myWeb loadHTMLString:featured.rd_html baseURL:nil];
            }else {
                return;
            }
            
        }
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
